package com.yonyou.iuap.shell.pub;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

import com.yonyou.iuap.base.sl.DesUtils;


public class DecryptPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer{
	@Override  
    protected String convertProperty(String propertyName,String propertyValue){  
        if(isEncryptPropertyVal(propertyName)){  
            return DesUtils.decode(propertyValue);//调用解密方法  
        }else{  
            return propertyValue;  
        }  
    }  
      
    private boolean isEncryptPropertyVal(String propertyName){  
        if(propertyName.startsWith("encrypt")){  
            return true;  
        }else{  
            return false;  
        }  
    }  
}
